package ui.mainwidget;
import org.eclipse.swt.SWT;

import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;

import ui.MainWindow;
import ui.resource.ResourceManager;
import ui.resource.ResourceURL;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class HomePage extends org.eclipse.swt.widgets.Composite {
	private Button MakePlanButton;

	{
		ResourceManager.registerResourceUser(this);
	}

	public HomePage(org.eclipse.swt.widgets.Composite parent, int style) {
		super(parent, style);
        this.addPaintListener(new PaintListener() {  
            public void paintControl(PaintEvent e) {  
                Point size  	=  HomePage.this.getSize();  
                Point location  =  HomePage.this.getLocation(); 
                Image image=ResourceManager.getImage(ResourceURL.getBackgroundImageURL());
                ImageData imageData=image.getImageData();
                e.gc.drawImage(image, 0, 0, imageData.width, imageData.height, location.x, location.y, size.x, size.y);  
            }
        });
		initGUI();
	}
	private void 								initGUI() {
		try {
			FormLayout thisLayout = new FormLayout();
			this.setLayout(thisLayout);
			this.setSize(MainWindow.getStandardWidth(), MainWindow.getStandardHeight());
			{
				MakePlanButton = new Button(this, SWT.PUSH | SWT.CENTER);
				FormData MakePlanButtonLData = new FormData();
				MakePlanButtonLData.left =  new FormAttachment(0, 1000, 89);
				MakePlanButtonLData.top =  new FormAttachment(0, 1000, 142);
				MakePlanButtonLData.width = 57;
				MakePlanButtonLData.height = 27;
				MakePlanButton.setLayoutData(MakePlanButtonLData);
				MakePlanButton.setText("button1");
			}
			this.layout();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
